/**
 * @param {number[]} nums1
 * @param {number[]} nums2
 * @return {number}
 */
var findMedianSortedArrays = function(nums1, nums2) {
  const nums = [...nums1, ...nums2].sort((a, b) => { return a - b });
  const mid = parseInt(nums.length / 2);
  if (nums.length % 2 != 0) return nums[mid];
  return (nums[mid] + nums[mid - 1]) / 2;
};

console.log(findMedianSortedArrays([3], []))